package com.pactera.asmp.server.entity;

import com.pactera.asmp.server.pojo.DeviceInfo;
import lombok.Data;

/**
 * @ProjectName: asmpserver
 * @Package: com.pactera.asmp.server.entity
 * @ClassName: DeviceDbcVo
 * @Author: lvzhiqiang
 * @Description: 设备-dbc关联实体
 * @Date: 2019/8/9 15:47
 * @Version: 1.0
 */
@Data
public class DeviceDbcVo extends DeviceInfo implements Comparable<DeviceDbcVo>{
    /**
     * dbc 文件解析表主键
     */
    private Long dbcFileCid;

    /**
     * dbc 文件解析表， dbc原始文件名
     */
    private String dbcFileName;

    /**
     * can port，如：CMD1
     */
    private String canCode;

    /**
     * 上位机 cuid
     */
    private String cuid;

    /**
     * can 状态，1-在线，2-离线
     */
    private byte canState;

    @Override
    public int compareTo(DeviceDbcVo o) {
        int s1 = this.getStatus();
        int s2 = o.getStatus();

        if(s1 == 1) {
            s1 = -1;
        }
        if(s2 == 1) {
            s2 = -1;
        }

        return s1 - s2;
    }
}
